<%@ page import="com.opeace.Senior" %>

<div class="fieldcontain ${hasErrors(bean: seniorInstance, field: 'firstName', 'error')} ">
	<label for="firstName">
		<g:message code="senior.firstName.label" default="First Name" />
		
	</label>
	<g:textField name="firstName" value="${seniorInstance?.firstName}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: seniorInstance, field: 'middleName', 'error')} ">
	<label for="middleName">
		<g:message code="senior.middleName.label" default="Middle Name" />
		
	</label>
	<g:textField name="middleName" value="${seniorInstance?.middleName}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: seniorInstance, field: 'lastName', 'error')} ">
	<label for="lastName">
		<g:message code="senior.lastName.label" default="Last Name" />
		
	</label>
	<g:textField name="lastName" value="${seniorInstance?.lastName}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: seniorInstance, field: 'gender', 'error')} required">
	<label for="gender">
		<g:message code="senior.gender.label" default="Gender" />
		<span class="required-indicator">*</span>
	</label>
	<g:select name="gender" from="${com.opeace.Person$Gender?.values()}" keys="${com.opeace.Person$Gender.values()*.name()}" required="" value="${seniorInstance?.gender?.name()}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: seniorInstance, field: 'birthDate', 'error')} required">
	<label for="birthDate">
		<g:message code="senior.birthDate.label" default="Birth Date" />
		<span class="required-indicator">*</span>
	</label>
	<g:datePicker name="birthDate" precision="day"  value="${seniorInstance?.birthDate}"  />
</div>

<div class="fieldcontain ${hasErrors(bean: seniorInstance, field: 'addressLine', 'error')} ">
	<label for="addressLine">
		<g:message code="senior.addressLine.label" default="Address Line" />
		
	</label>
	<g:textField name="addressLine" value="${seniorInstance?.addressLine}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: seniorInstance, field: 'addressAPT', 'error')} ">
	<label for="addressAPT">
		<g:message code="senior.addressAPT.label" default="Address APT" />
		
	</label>
	<g:textField name="addressAPT" value="${seniorInstance?.addressAPT}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: seniorInstance, field: 'addressCity', 'error')} ">
	<label for="addressCity">
		<g:message code="senior.addressCity.label" default="Address City" />
		
	</label>
	<g:textField name="addressCity" value="${seniorInstance?.addressCity}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: seniorInstance, field: 'addressState', 'error')} required">
	<label for="addressState">
		<g:message code="senior.addressState.label" default="Address State" />
		<span class="required-indicator">*</span>
	</label>
	<g:select name="addressState" from="${com.opeace.Person$State?.values()}" keys="${com.opeace.Person$State.values()*.name()}" required="" value="${seniorInstance?.addressState?.name()}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: seniorInstance, field: 'addressZip', 'error')} required">
	<label for="addressZip">
		<g:message code="senior.addressZip.label" default="Address Zip" />
		<span class="required-indicator">*</span>
	</label>
	<g:field type="number" name="addressZip" required="" value="${fieldValue(bean: seniorInstance, field: 'addressZip')}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: seniorInstance, field: 'homePhone', 'error')} ">
	<label for="homePhone">
		<g:message code="senior.homePhone.label" default="Home Phone" />
		
	</label>
	<g:textField name="homePhone" value="${seniorInstance?.homePhone}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: seniorInstance, field: 'hobby', 'error')} required">
	<label for="hobby">
		<g:message code="senior.hobby.label" default="Hobby" />
		<span class="required-indicator">*</span>
	</label>
	<g:select name="hobby" from="${com.opeace.Senior$Hobbies?.values()}" keys="${com.opeace.Senior$Hobbies.values()*.name()}" required="" value="${seniorInstance?.hobby?.name()}"/>
</div>